<template>
  <nav>
    <el-menu
    :router="true"
    :default-active="route.fullPath"
    class="el-menu-demo"
    mode="horizontal"
    @select="handleSelect"
  >
    <el-menu-item index="/">首页</el-menu-item>
    <el-menu-item index="/news">新闻中心</el-menu-item>
    <el-menu-item index="/product">产品服务</el-menu-item>
    </el-menu>
    <!-- <RouterLink to="/">Home</RouterLink>
    <RouterLink to="/product">About</RouterLink> -->
  </nav>

  <RouterView />
</template>
<script setup>
import { ref } from 'vue';
import { RouterLink, RouterView, useRoute, useRouter } from 'vue-router'
const activeIndex = ref('1')
const route= useRoute()
const router= useRouter()
</script>
